<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>LeoVue</title>
    <meta name="description" content="一个简洁的Vue.js组件库">
    <link rel="icon" href="/leovue/icons/57x57.png">
  <link rel="manifest" href="/leovue/manifest.json">
  <meta name="theme-color" content="#F00BA4">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <link rel="apple-touch-icon" href="/leovue/icons/152x152.png">
  <link rel="mask-icon" href="/leovue/icons/safari-pinned-tab.svg" color="#3eaf7c">
  <meta name="msapplication-TileImage" content="/leovue/icons/144x144.png">
  <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/leovue/assets/css/0.styles.2bae9745.css" as="style"><link rel="preload" href="/leovue/assets/js/app.bbd8fb51.js" as="script"><link rel="preload" href="/leovue/assets/js/14.e103f0c2.js" as="script"><link rel="prefetch" href="/leovue/assets/js/3.d3440eb0.js"><link rel="prefetch" href="/leovue/assets/js/1.c0330c93.js"><link rel="prefetch" href="/leovue/assets/js/4.7b6392ae.js"><link rel="prefetch" href="/leovue/assets/js/5.0d24eb3c.js"><link rel="prefetch" href="/leovue/assets/js/6.be3c1ae6.js"><link rel="prefetch" href="/leovue/assets/js/7.0077c48e.js"><link rel="prefetch" href="/leovue/assets/js/8.e9cb4d6e.js"><link rel="prefetch" href="/leovue/assets/js/9.d4e07c75.js"><link rel="prefetch" href="/leovue/assets/js/10.cd18093c.js"><link rel="prefetch" href="/leovue/assets/js/11.2f2ad536.js"><link rel="prefetch" href="/leovue/assets/js/12.0643b7fe.js"><link rel="prefetch" href="/leovue/assets/js/13.a86008f7.js"><link rel="prefetch" href="/leovue/assets/js/15.a1bc812b.js"><link rel="prefetch" href="/leovue/assets/js/16.8b9de87f.js"><link rel="prefetch" href="/leovue/assets/js/17.a58c599d.js">
    <link rel="stylesheet" href="/leovue/assets/css/0.styles.2bae9745.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/leovue/" class="home-link router-link-active"><!----> <span class="site-name">LeoVue</span></a> <div class="links" style="max-width:nullpx;"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.woodso.com?from=leovue" target="_blank" rel="noopener noreferrer" class="nav-link external">
  西阁码农
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/axolo/leovue" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.woodso.com?from=leovue" target="_blank" rel="noopener noreferrer" class="nav-link external">
  西阁码农
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/axolo/leovue" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><a href="/leovue/" class="sidebar-link">首页</a></li><li><div class="sidebar-group collapsable"><p class="sidebar-heading open"><span>组件</span> <span class="arrow down"></span></p> <ul class="sidebar-group-items"><li><a href="/leovue/api/leo-dialog.html" class="sidebar-link">leo-dialog</a></li><li><a href="/leovue/api/leo-lodop.html" class="active sidebar-link">leo-lodop</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/leovue/api/leo-lodop.html#示例" class="sidebar-link">示例</a></li><li class="sidebar-sub-header"><a href="/leovue/api/leo-lodop.html#说明" class="sidebar-link">说明</a></li><li class="sidebar-sub-header"><a href="/leovue/api/leo-lodop.html#代码" class="sidebar-link">代码</a></li><li class="sidebar-sub-header"><a href="/leovue/api/leo-lodop.html#属性" class="sidebar-link">属性</a></li><li class="sidebar-sub-header"><a href="/leovue/api/leo-lodop.html#事件" class="sidebar-link">事件</a></li></ul></li><li><a href="/leovue/api/leo-export.html" class="sidebar-link">leo-export</a></li><li><a href="/leovue/api/leo-import.html" class="sidebar-link">leo-import</a></li><li><a href="/leovue/api/leo-upload.html" class="sidebar-link">leo-upload</a></li></ul></div></li><li><a href="/leovue/changelog.html" class="sidebar-link">修订</a></li><li><a href="/leovue/postscript.html" class="sidebar-link">后记</a></li></ul> <div class="sidebar-bottom" data-v-50df324a><div class="pages" data-v-50df324a>
    Hosted by <a href="https://pages.github.com" style="font-weight: bold" data-v-50df324a>GitHub Pages</a></div> <div class="google-ads" data-v-50df324a><ins data-ad-client="ca-pub-4521521675997745" data-ad-slot="8498299482" data-ad-format="auto" data-full-width-responsive="true" class="adsbygoogle" style="display:block" data-v-50df324a></ins></div></div></div> <div class="page"> <div class="content"><h1 id="leo-lodop"><a href="#leo-lodop" aria-hidden="true" class="header-anchor">#</a> leo-lodop</h1> <h2 id="示例"><a href="#示例" aria-hidden="true" class="header-anchor">#</a> 示例</h2> <!----> <h2 id="说明"><a href="#说明" aria-hidden="true" class="header-anchor">#</a> 说明</h2> <p>调用LODOP打印，本组件依赖于<a href="http://www.lodop.net" target="_blank" rel="noopener noreferrer">LODOP<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>，请自行下载安装配置。
<a href="http://www.lodop.net/LodopDemo.html" target="_blank" rel="noopener noreferrer">LODOP演示及文档<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>细节不够完美，需要自行测试。
如：</p> <ul><li>HTM格式：矢量打印，文字非常清晰</li> <li>HTML格式：整个文档转换为低画质图片后打印 😦</li></ul> <h4 id="模板选择对话框"><a href="#模板选择对话框" aria-hidden="true" class="header-anchor">#</a> 模板选择对话框</h4> <p><img src="/leovue/assets/img/leo-lodop-dialog.403602d2.png" alt="模板选择对话框"></p> <h4 id="打印预览"><a href="#打印预览" aria-hidden="true" class="header-anchor">#</a> 打印预览</h4> <p><img src="/leovue/assets/img/leo-lodop-preview.59a56ccf.png" alt="打印预览"></p> <h2 id="代码"><a href="#代码" aria-hidden="true" class="header-anchor">#</a> 代码</h2> <div class="language-vue extra-class"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>leo-lodop<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>thead</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>tr</span><span class="token punctuation">&gt;</span></span>
          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>th</span><span class="token punctuation">&gt;</span></span>编号<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>th</span><span class="token punctuation">&gt;</span></span>
          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>th</span><span class="token punctuation">&gt;</span></span>名称<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>th</span><span class="token punctuation">&gt;</span></span>
          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>th</span><span class="token punctuation">&gt;</span></span>网址<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>th</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>tr</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>thead</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>tbody</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>tr</span> <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>item in data<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>item.id<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>td</span><span class="token punctuation">&gt;</span></span>{{item.id}}<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>td</span><span class="token punctuation">&gt;</span></span>
          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>td</span><span class="token punctuation">&gt;</span></span>{{item.name}}<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>td</span><span class="token punctuation">&gt;</span></span>
          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>td</span><span class="token punctuation">&gt;</span></span>{{item.site}}<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>td</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>tr</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>tbody</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>small</span><span class="token punctuation">&gt;</span></span>LODOP：<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>small</span><span class="token punctuation">&gt;</span></span>&lt;input class=&quot;new-lodop&quot; type=&quot;text&quot;v-model=&quot;newLodop&quot;&gt;
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>print<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>打印<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>leo-lodop</span>
      <span class="token attr-name">:visible.sync</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>visible<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span><span class="token punctuation">'</span>网站列表<span class="token punctuation">'</span><span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:data</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>data<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:templates</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>templates<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:lodop</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>lodop<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>leo-lodop</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script language-javascript">
<span class="token keyword">import</span> <span class="token punctuation">{</span> LeoLodop <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@axolo/leovue'</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  components<span class="token punctuation">:</span> <span class="token punctuation">{</span> LeoLodop <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token keyword">return</span> <span class="token punctuation">{</span>
    visible<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    lodop<span class="token punctuation">:</span> <span class="token string">'http://localhost:8000/CLodopfuncs.js'</span><span class="token punctuation">,</span>
    newLodop<span class="token punctuation">:</span> <span class="token string">''</span><span class="token punctuation">,</span>
    data<span class="token punctuation">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> id<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span> name<span class="token punctuation">:</span> <span class="token string">'西阁码农'</span><span class="token punctuation">,</span> site<span class="token punctuation">:</span> <span class="token string">'www.woodso.com'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> id<span class="token punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span> name<span class="token punctuation">:</span> <span class="token string">'Vue.js'</span><span class="token punctuation">,</span>   site<span class="token punctuation">:</span> <span class="token string">'cn.vuejs.org'</span>   <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> id<span class="token punctuation">:</span> <span class="token number">3</span><span class="token punctuation">,</span> name<span class="token punctuation">:</span> <span class="token string">'GitHub'</span><span class="token punctuation">,</span>   site<span class="token punctuation">:</span> <span class="token string">'www.github.com'</span> <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    templates<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
      <span class="token string">&quot;id&quot;</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
      <span class="token string">&quot;label&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;accounts&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;name&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;A4竖版&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;bio&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;自适应纸张&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;url&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;/leovue/static/lodop/site-a4.html&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;engine&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;dot&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;format&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;TABLE&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;params&quot;</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
        <span class="token string">&quot;left&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;7.5%&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;top&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;7.5%&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;width&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;RightMargin:7.5%&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;height&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;BottomMargin:7.5%&quot;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token string">&quot;default&quot;</span><span class="token punctuation">:</span> <span class="token boolean">false</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
      <span class="token string">&quot;id&quot;</span><span class="token punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span>
      <span class="token string">&quot;label&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;accounts&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;name&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;POS小票&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;bio&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;80mm热敏纸&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;url&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;/leovue/static/lodop/site-80mm.html&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;engine&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;dot&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;format&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;HTM&quot;</span><span class="token punctuation">,</span>
      <span class="token string">&quot;params&quot;</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
        <span class="token string">&quot;left&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;5%&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;top&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;1.0cm&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;width&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;RightMargin:5%&quot;</span><span class="token punctuation">,</span>
        <span class="token string">&quot;height&quot;</span><span class="token punctuation">:</span> <span class="token string">&quot;BottomMargin:1.0cm&quot;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token string">&quot;default&quot;</span><span class="token punctuation">:</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">]</span>
  <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">mounted</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>newLodop <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>lodop
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  methods<span class="token punctuation">:</span> <span class="token punctuation">{</span>
    <span class="token function">print</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>lodop <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>newLodop
      <span class="token keyword">this</span><span class="token punctuation">.</span>visible <span class="token operator">=</span> <span class="token boolean">true</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style language-css">
<span class="token selector">#leo-lodop</span> <span class="token punctuation">{</span>
  <span class="token property">margin</span><span class="token punctuation">:</span> 5px<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token selector">.new-lodop</span> <span class="token punctuation">{</span>
  <span class="token property">width</span><span class="token punctuation">:</span> 300px<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><div class="tip custom-block"><p class="custom-block-title">打印模板</p> <p>doT.js格式打印模板</p></div> <div class="language-html extra-class"><pre class="language-html"><code><span class="token comment">&lt;!-- site-80mm.html (HTML with doT.js Template) --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">&gt;</span></span><span class="token style language-css">
  <span class="token selector">.label</span> <span class="token punctuation">{</span> <span class="token property">font-weight</span><span class="token punctuation">:</span> bold<span class="token punctuation">;</span> <span class="token punctuation">}</span>
  <span class="token selector">.label:after</span> <span class="token punctuation">{</span> <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">'：'</span><span class="token punctuation">;</span> <span class="token punctuation">}</span>
  <span class="token selector">.main</span> <span class="token punctuation">{</span> <span class="token property">font-size</span><span class="token punctuation">:</span> small<span class="token punctuation">;</span> <span class="token property">margin-bottom</span><span class="token punctuation">:</span> 10<span class="token punctuation">;</span> <span class="token punctuation">}</span>
  <span class="token selector">h4</span> <span class="token punctuation">{</span> <span class="token property">margin</span><span class="token punctuation">:</span> 5 0<span class="token punctuation">;</span> <span class="token punctuation">}</span>
  <span class="token selector">hr</span> <span class="token punctuation">{</span> <span class="token property">border</span><span class="token punctuation">:</span> 1px dashed darkgray<span class="token punctuation">;</span> <span class="token punctuation">}</span>
</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h4</span><span class="token punctuation">&gt;</span></span>网站列表<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h4</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>hr</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>main<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>{{~it:v:i}}
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>label<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>序号<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>content<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>{{=v.id}}<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>label<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>名称<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>content<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>{{=v.name}}<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>label<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>网址<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>content<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>{{=v.site}}<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>hr</span><span class="token punctuation">&gt;</span></span>{{~}}
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>制表：<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
</code></pre></div><h2 id="属性"><a href="#属性" aria-hidden="true" class="header-anchor">#</a> 属性</h2> <table><thead><tr><th>名称</th> <th>类型</th> <th>说明</th> <th>默认值</th> <th>必填</th></tr></thead> <tbody><tr><td>visible</td> <td>Boolean</td> <td>可见性</td> <td></td> <td></td></tr> <tr><td>title</td> <td>String</td> <td>标题</td> <td></td> <td></td></tr> <tr><td>data</td> <td>Object</td> <td>需要打印的数据</td> <td></td> <td></td></tr> <tr><td>templates</td> <td>Array</td> <td>打印模板列表</td> <td></td> <td>是</td></tr> <tr><td>server</td> <td>String</td> <td>指定打印服务器</td> <td><code>http://localhost:8000/CLodopfuncs.js</code></td> <td></td></tr></tbody></table> <h2 id="事件"><a href="#事件" aria-hidden="true" class="header-anchor">#</a> 事件</h2> <p>无</p></div> <div class="page-edit"><!----> <div class="last-updated"><span class="prefix">上次更新: </span> <span class="time">8/20/2018, 9:46:20 PM</span></div></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/leovue/api/leo-dialog.html" class="prev">
          leo-dialog
        </a></span> <span class="next"><a href="/leovue/api/leo-export.html">
          leo-export
        </a>
        →
      </span></p></div> </div> <!----></div></div>
    <script src="/leovue/assets/js/14.e103f0c2.js" defer></script><script src="/leovue/assets/js/app.bbd8fb51.js" defer></script>
  </body>
</html>
